﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SaturniLibrary.Web.Log
{
    public class StopWatch
    {
        private readonly DateTime startTime;
        private DateTime endTime = DateTime.Now;

        public StopWatch()
        {
            startTime = DateTime.Now;
        }

        public void Stop()
        {
            endTime = DateTime.Now;
        }

        public long ElapsedMs()
        {
            return (long)endTime.Subtract(startTime).TotalMilliseconds;
        }
    }
}
